package sistemasdistribuidos;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import static sistemasdistribuidos.agendaBanhoTosa.flag;
import telasMensagem.bloqueio;
import telasMensagem.simNao;

public class incluirAgendamento extends javax.swing.JDialog {

    static boolean fecha = false;

    public incluirAgendamento(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    public incluirAgendamento(java.awt.Frame parent, boolean modal, String data, String hora, String banhista) {
        super(parent, modal);
        initComponents();
        jLabelBanhista.setText(banhista);
        jLabelData.setText(data);
        jLabelHorario.setText(hora);
        jTextFieldAnimal.setEditable(false);
        jTextFieldCodigoAnimal.setEditable(false);
        jTextFieldDono.setEditable(false);
        
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                simNao sn = new simNao(null, true, "<html>Tem certeza que deseja "
                        + "sair sem salvar o agendamento? Todos os dados inseridos "
                        + "serão perdidos!<html>", 2);
                sn.setLocationRelativeTo(null);
                sn.setVisible(true);
                if (fecha == true) {
                    dispose();
                }
            }
        }
        );
    }

    public static void devolve(String codigo, String animal, String dono) {
        jTextFieldAnimal.setText(animal);
        jTextFieldCodigoAnimal.setText(codigo);
        jTextFieldDono.setText(dono);
    }

    public static void fechar(boolean t) {
        fecha = t;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabelMsg10 = new javax.swing.JLabel();
        jLabelMsg14 = new javax.swing.JLabel();
        jButtonSalvarCadastroAgenda = new javax.swing.JButton();
        jButtonLimparDados = new javax.swing.JButton();
        jLabelMsg12 = new javax.swing.JLabel();
        jLabelMsg13 = new javax.swing.JLabel();
        jLabelMsg16 = new javax.swing.JLabel();
        jLabelMsg17 = new javax.swing.JLabel();
        jTextFieldAnimal = new javax.swing.JTextField();
        jTextFieldDono = new javax.swing.JTextField();
        jLabelMsg19 = new javax.swing.JLabel();
        jTextFieldCodigo = new javax.swing.JTextField();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTableServiços = new javax.swing.JTable();
        jLabelMsg20 = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTextPaneObservacoes = new javax.swing.JTextPane();
        jLabelBanhista = new javax.swing.JLabel();
        jLabelData = new javax.swing.JLabel();
        jButtonBuscar = new javax.swing.JButton();
        jLabelMsg21 = new javax.swing.JLabel();
        jTextFieldCodigo1 = new javax.swing.JTextField();
        jButtonBuscar2 = new javax.swing.JButton();
        jLabelHorario = new javax.swing.JLabel();
        jLabelMsg18 = new javax.swing.JLabel();
        jTextFieldCodigoAnimal = new javax.swing.JTextField();
        jLabelMsg22 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Incluir Agendamento ");
        setAlwaysOnTop(true);
        setAutoRequestFocus(false);
        setModal(true);

        jPanel1.setBackground(new java.awt.Color(255, 102, 0));
        jPanel1.setBorder(javax.swing.BorderFactory.createMatteBorder(3, 3, 3, 3, new java.awt.Color(0, 0, 0)));

        jLabelMsg10.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg10.setText("Data:");

        jLabelMsg14.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N
        jLabelMsg14.setText("Incluir Novo Agendamento");

        jButtonSalvarCadastroAgenda.setBackground(new java.awt.Color(255, 255, 255));
        jButtonSalvarCadastroAgenda.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jButtonSalvarCadastroAgenda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/pata.png"))); // NOI18N
        jButtonSalvarCadastroAgenda.setText("Salvar");
        jButtonSalvarCadastroAgenda.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButtonSalvarCadastroAgenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSalvarCadastroAgendaActionPerformed(evt);
            }
        });

        jButtonLimparDados.setBackground(new java.awt.Color(255, 255, 255));
        jButtonLimparDados.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jButtonLimparDados.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/osso.png"))); // NOI18N
        jButtonLimparDados.setText("Cancelar");
        jButtonLimparDados.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButtonLimparDados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonLimparDadosActionPerformed(evt);
            }
        });

        jLabelMsg12.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg12.setText("Profissional:");

        jLabelMsg13.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg13.setText("Horário:");

        jLabelMsg16.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg16.setText("Animal:");
        jLabelMsg16.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelMsg16jLabelMsg17MouseClicked(evt);
            }
        });

        jLabelMsg17.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg17.setText("Dono:");
        jLabelMsg17.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelMsg17MouseClicked(evt);
            }
        });

        jTextFieldAnimal.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jTextFieldAnimal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldAnimalActionPerformed(evt);
            }
        });

        jTextFieldDono.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jTextFieldDono.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldDonoActionPerformed(evt);
            }
        });

        jLabelMsg19.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg19.setText("Código:");

        jTextFieldCodigo.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jTextFieldCodigo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldCodigoActionPerformed(evt);
            }
        });

        jTableServiços.setBorder(javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, new java.awt.Color(0, 0, 0)));
        jTableServiços.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N
        jTableServiços.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Horário", "Cachorro"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane4.setViewportView(jTableServiços);

        jLabelMsg20.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg20.setText("Observações:");

        jTextPaneObservacoes.setEditable(false);
        jTextPaneObservacoes.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jTextPaneObservacoes.setEnabled(false);
        jScrollPane6.setViewportView(jTextPaneObservacoes);

        jLabelBanhista.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelBanhista.setText("Banhista");

        jLabelData.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelData.setText("22/22/2222");

        jButtonBuscar.setBackground(new java.awt.Color(255, 255, 255));
        jButtonBuscar.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jButtonBuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Busca_Icon.png"))); // NOI18N
        jButtonBuscar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButtonBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonBuscarActionPerformed(evt);
            }
        });

        jLabelMsg21.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg21.setText("Adicionar Serviços ao Banho:");

        jTextFieldCodigo1.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jTextFieldCodigo1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldCodigo1ActionPerformed(evt);
            }
        });

        jButtonBuscar2.setBackground(new java.awt.Color(255, 255, 255));
        jButtonBuscar2.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jButtonBuscar2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Busca_Icon.png"))); // NOI18N
        jButtonBuscar2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButtonBuscar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonBuscar2ActionPerformed(evt);
            }
        });

        jLabelHorario.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelHorario.setText("Horário:");

        jLabelMsg18.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg18.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/banhos.png"))); // NOI18N

        jTextFieldCodigoAnimal.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jTextFieldCodigoAnimal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldCodigoAnimalActionPerformed(evt);
            }
        });

        jLabelMsg22.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg22.setText("Código do Animal:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(178, 178, 178)
                        .addComponent(jLabelMsg14))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(16, 16, 16)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(165, 165, 165)
                                        .addComponent(jButtonSalvarCadastroAgenda, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabelMsg22)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jTextFieldCodigoAnimal, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(44, 44, 44)
                                .addComponent(jButtonLimparDados, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabelMsg12)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabelBanhista))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabelMsg16)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jTextFieldAnimal, javax.swing.GroupLayout.PREFERRED_SIZE, 308, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jButtonBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabelMsg21)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextFieldCodigo1, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jButtonBuscar2, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabelMsg17)
                                            .addGap(18, 18, 18)
                                            .addComponent(jTextFieldDono, javax.swing.GroupLayout.PREFERRED_SIZE, 349, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(4, 4, 4)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabelMsg20)
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                                                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 424, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabelMsg18, javax.swing.GroupLayout.PREFERRED_SIZE, 296, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addComponent(jLabelMsg10)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(jLabelData, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addComponent(jLabelMsg13)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(jLabelHorario))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addComponent(jLabelMsg19)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jTextFieldCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                        .addGap(44, 44, 44)))))))
                .addContainerGap(13, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonLimparDados, jButtonSalvarCadastroAgenda});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(jLabelMsg14)
                .addGap(11, 11, 11)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelMsg12)
                    .addComponent(jLabelBanhista))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelMsg22)
                            .addComponent(jTextFieldCodigoAnimal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(5, 5, 5)
                                .addComponent(jLabelMsg16))
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jButtonBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jTextFieldAnimal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextFieldDono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelMsg17))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelMsg19)
                            .addComponent(jTextFieldCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelHorario)
                            .addComponent(jLabelMsg13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelMsg10)
                            .addComponent(jLabelData))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(5, 5, 5)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextFieldCodigo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabelMsg21)))
                            .addComponent(jButtonBuscar2, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(23, 23, 23)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelMsg20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabelMsg18, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonSalvarCadastroAgenda, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonLimparDados, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonLimparDados, jButtonSalvarCadastroAgenda});

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonSalvarCadastroAgendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSalvarCadastroAgendaActionPerformed
        /* salvar no banco e reabrir a agenda atualizando o agendamento*/
        agendaBanhoTosa abt = new agendaBanhoTosa(null, true);
        abt.setLocationRelativeTo(null);
        abt.setVisible(true);
    }//GEN-LAST:event_jButtonSalvarCadastroAgendaActionPerformed

    private void jButtonLimparDadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLimparDadosActionPerformed

    }//GEN-LAST:event_jButtonLimparDadosActionPerformed

    private void jLabelMsg16jLabelMsg17MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelMsg16jLabelMsg17MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jLabelMsg16jLabelMsg17MouseClicked

    private void jLabelMsg17MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelMsg17MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jLabelMsg17MouseClicked

    private void jTextFieldAnimalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldAnimalActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldAnimalActionPerformed

    private void jTextFieldDonoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldDonoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldDonoActionPerformed

    private void jTextFieldCodigoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldCodigoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldCodigoActionPerformed

    private void jButtonBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBuscarActionPerformed
        /*   try {
         animaisCadastrados a = new animaisCadastrados(null, true, 1);
         a.setLocationRelativeTo(null);
         a.setVisible(true);
         } catch (Exception ex) {
         System.out.println(ex);
         }*/
    }//GEN-LAST:event_jButtonBuscarActionPerformed

    private void jTextFieldCodigo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldCodigo1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldCodigo1ActionPerformed

    private void jButtonBuscar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBuscar2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButtonBuscar2ActionPerformed

    private void jTextFieldCodigoAnimalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldCodigoAnimalActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldCodigoAnimalActionPerformed

    public static void main(String args[]) {

        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(incluirAgendamento.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(incluirAgendamento.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(incluirAgendamento.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(incluirAgendamento.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                incluirAgendamento dialog = new incluirAgendamento(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonBuscar;
    private javax.swing.JButton jButtonBuscar2;
    private javax.swing.JButton jButtonLimparDados;
    private javax.swing.JButton jButtonSalvarCadastroAgenda;
    private javax.swing.JLabel jLabelBanhista;
    private javax.swing.JLabel jLabelData;
    private javax.swing.JLabel jLabelHorario;
    private javax.swing.JLabel jLabelMsg10;
    private javax.swing.JLabel jLabelMsg12;
    private javax.swing.JLabel jLabelMsg13;
    private javax.swing.JLabel jLabelMsg14;
    private javax.swing.JLabel jLabelMsg16;
    private javax.swing.JLabel jLabelMsg17;
    private javax.swing.JLabel jLabelMsg18;
    private javax.swing.JLabel jLabelMsg19;
    private javax.swing.JLabel jLabelMsg20;
    private javax.swing.JLabel jLabelMsg21;
    private javax.swing.JLabel jLabelMsg22;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTable jTableServiços;
    public static javax.swing.JTextField jTextFieldAnimal;
    public static javax.swing.JTextField jTextFieldCodigo;
    public static javax.swing.JTextField jTextFieldCodigo1;
    public static javax.swing.JTextField jTextFieldCodigoAnimal;
    public static javax.swing.JTextField jTextFieldDono;
    public static javax.swing.JTextPane jTextPaneObservacoes;
    // End of variables declaration//GEN-END:variables
}
